# coding: utf-8
from marshmallow import fields, validate

from app.api.utils import EmptyStrValidator
from app.constant import Gender
from ..extensions import ma


class SupplierCertifySchema(ma.Schema):
    """
    create by ld_wu 2017-11-20
    """
    nickname = fields.Str(
        required=True,
        error_messages={'required': '昵称为必填'},
        validate=EmptyStrValidator(error='昵称不合法')
    )
    gender = fields.Int(
        required=True,
        error_messages={'required': '性别为必填'},
        validate=validate.OneOf(Gender.values(), error='性别不合法'))
    com = fields.Str()


supplier_certify_schema = SupplierCertifySchema()
